﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AGameOfThrones.tokens
{
    /// <summary>
    /// Interaction logic for powertokensavailable.xaml
    /// </summary>
    public partial class powertokensavailable : UserControl
    {
        public powertokensavailable()
        {
            InitializeComponent();
        }

        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            game.house h = this.DataContext as game.house;
            if (h != null)
            {
                for (int i = 0; i < h.PowerTokensAvailable.Count; i++)
                {
                    game.powertoken powertoken = h.PowerTokensAvailable[i];
                    powertoken.FrontImage = h.PowerTokenImage;
                    piece.piece piece = new piece.piece();
                    piece.DataContext = powertoken;
                    powertokensavailable_panel.Children.Add(piece);

                    powertoken.Position.Panel = powertokensavailable_panel.Name;
                    powertoken.Position.X = 0;
                    powertoken.Position.Y = 0;
                }
            }
        }
    }
}
